From b63ad5299f089c93ac9e3276c1a20eeeded34744 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 7 Feb 2019 16:07:03 +0000 Subject: [PATCH] xen init script: Tidy up wrong/missing Xen version error handling We no longer want to discard the stderr from xen-dir, and treat this as a success. All the reasons why this failure might previously have been thought tolerable have been dealt with. Specifically, we will no longer reach this code if we are not running under Xen, or if we ran this init script on behalf of a xen-utils-V package for some V different to the running Xen version. We know we are running under Xen, and that either we're running not as a result of a maint script, or as a result of a xen-utils-V maint script for the running Xen version, or as a result of some other maint script (of which we don't think there are any, but it presumably expects this code to work). So if xen-dir fails, let it print its error message, and also exit nonzero. And don't mention not running under Xen in our log_warning_msg. Signed-off-by: Ian Jackson Acked-by: Hans van Kranenburg --- debian/xen-utils-common.xen.init | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/xen-utils-common.xen.init b/debian/xen-utils-common.xen.init index b0df7be8ab..a352823040 100644 --- a/debian/xen-utils-common.xen.init +++ b/debian/xen-utils-common.xen.init @@ -53,10 +53,10 @@ xen-utils-*) exit 0;; # xen-utils-V maintscript, but under Xen X!=V *) ;; # maybe not under dpkg, etc. esac -ROOT=$(/usr/lib/xen-common/bin/xen-dir 2>/dev/null) +ROOT=$(/usr/lib/xen-common/bin/xen-dir) if [ $? -ne 0 ]; then - log_warning_msg "Not running within Xen or no compatible utils" - exit 0 + log_warning_msg "No compatible Xen utils for Xen $VERSION" + exit 1 fi XENCONSOLED="$ROOT"/bin/xenconsoled -- 2.30.2